#pragma once 

#include <odb/mysql/database.hxx>
#include <odb/mysql/connection.hxx>
#include <memory>

namespace  lyt {

    class mysql_build{
    public:
        static std::shared_ptr<odb::mysql::database> build(
            const std::string& user,
            const std::string& passwd,
            const std::string& db_name,
            const std::string& host,
            size_t port,
            const std::string& charset,
            size_t conn_pool_num
        ) {
            std::unique_ptr<odb::mysql::connection_pool_factory> pool(new odb::mysql::connection_pool_factory(conn_pool_num));
            auto ret =  std::make_shared<odb::mysql::database>(user,passwd,db_name,host,port,"",charset,0,std::move(pool));
            return ret;
        }
    };
}